fix(completion): use InsertAsSnippet for query language commands#416
Merged
Conversation
Query language commands (ESQL, SQL, EQL, PPL) use $0 snippet placeholders in their insertText, but the completion provider was inserting them as plain text (InsertTextRule.None). This caused literal $0 to appear in the editor when accepting completions like WHERE, FROM, SELECT, etc. Changed insertTextRules from None to InsertAsSnippet so Monaco correctly interprets the snippet placeholders. Fixes #412
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #416 +/- ##
=======================================
Coverage 64.68% 64.68%
=======================================
Files 47 47
Lines 2308 2308
Branches 597 597
=======================================
Hits 1493 1493
Misses 698 698
Partials 117 117 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Blankll
added a commit
that referenced
this pull request
May 19, 2026
…onfig CTA in chat panel - completionProvider.ts: restore InsertAsSnippet for query language command completions (ESQL/SQL/EQL/PPL) — matches origin 1f914c9 and aligns with PR #416 fix; ultimate had re-introduced the None regression - chat-panel.vue: restore 'Configure GPT' settings CTA button in error banner when AI is not configured, matching origin chatbot-box behavior; add useRouter import and error-settings-btn CSS
Blankll
added a commit
that referenced
this pull request
May 19, 2026
…dio view (#431) ## Summary Syncs AI/agent improvements from the private `ultimate` branch into the public repo. ### What's included **Rust agent backend** (`src-tauri/src/agent/`) - Multi-provider LLM agent with loop runner, tool executor, session store (SQLite via rusqlite) - Supports OpenAI, DeepSeek, OpenRouter, Ollama, LM Studio - Replaces the old `openai_client` module (removed) - New Tauri commands: `start_agent_session`, `send_agent_message`, `validate_llm_config`, `list_llm_models`, etc. **Data Studio view** (`src/views/data-studio/`) - Full chat-driven data exploration interface - Session history, tool confirmation cards, source management modals **Agent composables & stores** - `useAgentContext`, `useChatAgent`, `useSidebarChatAgent`, `useDataStudioAgent`, `useDataStudioChatAgent` - `dataStudioStore`, `codeActionStore` - `appStore`: `ProviderConfig`, `ModelRef`, `getResolvedFeatureModel` for multi-provider support; migrates legacy `aiConfigs` secret to new `LlmSettings` on first load **Shared agent UI components** - `agent-message-bubble`, `chat-panel` (with missing-AI-config CTA), `model-picker` **AI settings** (`src/views/setting/components/aigc.vue`) - Replaced per-provider tabs (OpenAI / DeepSeek) with unified multi-provider settings - Supports all five providers: OpenAI, DeepSeek, OpenRouter, Ollama, LM Studio - System prompt is now dynamically built from live database schema context (richer than the static user-editable prompt in origin) **Accessibility & UX improvements** - `SearchableSelect`: full keyboard navigation (arrow keys, Enter, Escape, ARIA) - `path-breadcrumb`, `tool-bar-right`: keyboard + ARIA accessibility - `DialogContent`: pointer-events fix for closed overlay - Monaco `completionProvider`: `InsertAsSnippet` for query language commands (ESQL/SQL/EQL/PPL) — aligns with #416 - Sidebar chat `chatbot-box`: resizable panel, session history, upgraded to agent-based architecture **i18n**: agent/data-studio keys added to `enUS` and `zhCN` **MongoDB: always visible** - Removed `VITE_FEATURE_MONGODB` feature flag and `__MONGODB_ENABLED__` Vite define - MongoDB is now shown in all environments (dev and production) - `featureFlags.ts` retained for compatibility but no longer gates MongoDB ### What's excluded - All login/auth/Geekfun account features - `authService.ts`, login views, `orContinueWith`/`loginWithGeekfun` i18n keys ### What's preserved from origin - Full MongoDB support (`mongo_client.rs`, `mongoApi.ts`, mongo editor) - All DynamoDB extended features (delete/truncate/update-table-config/pitr/streams/ttl modules) - Origin's `connectionStore.ts` (has OpenSearch, EasySearch, MongoDB types — ahead of ultimate) - Origin's `fetch_client.rs` (OnceLock-based, safer than ultimate's static mut version) - `featureFlags.ts` + its tests (no longer gates MongoDB, but preserved) - All keyboard accessibility and OpenSearch/EasySearch guards in import/export views ### Verification - `tsc --noEmit` ✅ - `eslint` ✅ (0 errors) - `jest` ✅ 31 suites / 1280 tests --------- Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
$0) leaking into query language command completionsinsertTextRulesfromNonetoInsertAsSnippetfor command keywordsProblem
When accepting completions for query language commands (ESQL, SQL, EQL, PPL) inside the
querybody field of_query,_sql,_eql/search, and_plugins/_pplendpoints, the literal text$0was inserted into the editor.For example, completing
WHEREproducedWHERE $0instead ofWHEREwith cursor positioned after it.Root Cause
The command definitions use Monaco snippet placeholders in their
insertText:But the completion provider used
InsertTextRule.None, which inserts text literally without interpreting snippet syntax.Fix
Changed
insertTextRulesatcompletionProvider.ts:764:This affects all four query languages: ESQL, SQL, EQL, and PPL.
Verification
insertTextRulesusages)Refers: #412